var t = getApp();

Component({
    options: {
        styleIsolation: "apply-shared",
        multipleSlots: !0
    },
    properties: {
        custom_name_state: {
            type: null,
            value: 0
        },
        datas: {
            type: Object,
            value: {},
            observer: function(t, e) {
                t.store_introduce && (this.setData({
                    contentNode: t.information.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
                }), this.getTextRect());
            }
        }
    },
    lifetimes: {
        ready: function() {
            this.getTextRect();
        }
    },
    data: {
        showMore: !1,
        readmore: !1,
        contentNode: ""
    },
    methods: {
        getTextRect: function() {
            var t = this;
            wx.createSelectorQuery().in(this).select(".introduce-text").boundingClientRect().exec(function(e) {
                e[0].height / 20 <= 4 ? t.setData({
                    showMore: !1
                }) : t.setData({
                    showMore: !0,
                    readmore: !0
                });
            });
        },
        phoneCall: function(e) {
            var a = e.currentTarget.dataset.mobile, r = e.currentTarget.dataset.realname;
            a ? this.triggerEvent("contactPopup", {
                mobile: a,
                name: r
            }) : t.tips("该员工未备注手机号");
        },
        copyWx: function(e) {
            var a = e.currentTarget.dataset.wechat;
            a ? wx.setClipboardData({
                data: a,
                success: function(e) {
                    t.tips("复制成功");
                },
                fail: function(e) {
                    t.tips("复制失败");
                }
            }) : t.tips("该员工暂无微信号");
        },
        toggle: function() {
            this.setData({
                readmore: !this.data.readmore
            });
        },
        goBusinessCard: function(t) {
            var e = t.currentTarget.dataset.item;
            e.card_id && wx.navigateTo({
                url: "/packageB/member/business_card/BusinessCard/BusinessCard?mark=card&card_id=" + e.card_id
            });
        }
    }
});